package com.simpd.activity;

import cn.pedant.SweetAlert.SweetAlertDialog;

import com.example.simpd.R;

import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
import android.webkit.WebView;
import android.webkit.WebSettings.PluginState;

public class LocalHtmlActivity extends Activity{
	WebView browser;
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.detail_notifikasi);
		
		try {
			
		browser = (WebView) findViewById(R.id.detail_notifikasi_webview); 
		String filePath = Environment.getExternalStorageDirectory().getAbsolutePath()+"/simpd/sample/test.html";
		browser.loadUrl("file:///"+filePath);
		browser.getSettings().setBuiltInZoomControls(true);
		browser.getSettings().setUseWideViewPort(true);
		browser.getSettings().setDisplayZoomControls(false);
		browser.getSettings().setJavaScriptEnabled(true);
		browser.getSettings().setPluginState(PluginState.ON);
		
		} catch (Exception e) {
			SweetAlertDialog alert = new SweetAlertDialog(getApplicationContext(), SweetAlertDialog.ERROR_TYPE);
			alert.setTitleText("Oops..!!!");
			alert.setContentText("Terjadi kesalahan : "+e.getMessage());
			alert.show();
		}
		
	};
}
